/**
 * 
 */
package Connexion;

import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Connection;
import java.sql.Statement;


/**
 * @author tangi
 * @see mysqlConnector.java
 */

public class mysqlConnector {
	private static Statement stmt;
	
	public static int requete(String query, Connection connection){		
		try {
			stmt = connection.createStatement();
			int rs = stmt.executeUpdate(query);			
			return rs;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return 0;
	}
	
	public static ResultSet requeteSelect(String query,Connection connection){		
		try {
			stmt = connection.createStatement();
			ResultSet rs = stmt.executeQuery(query);
			return rs;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}
	
}
